//
//  WSMusicDetailsCell.m
//  RunningMan
//
//  Created by 王帅 on 16/5/23.
//  Copyright © 2016年 WSJ. All rights reserved.
//

#import "WSMusicDetailsCell.h"
#import "WSMyTool.h"
@interface WSMusicDetailsCell ()
@property (nonatomic, strong) UIImageView *imageViewPhoto;
@property (nonatomic, strong) UILabel *labelSongname;
@property (nonatomic, strong) UILabel *labelSonger;
@end
@implementation WSMusicDetailsCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubView];
    }
    return  self;
}

- (void)createSubView {
    
    self.imageViewPhoto = [[UIImageView alloc] initWithFrame:CGRectMake(10 * FITWIDTH, 10 * FITHEIGHT, 110 * FITWIDTH, 80 * FITHEIGHT)];
    [self.contentView addSubview:self.imageViewPhoto];
    
    self.labelSongname = [[UILabel alloc] initWithFrame:CGRectMake(130 * FITWIDTH, 10 * FITHEIGHT, 250 * FITWIDTH, 30 * FITHEIGHT)];
    self.labelSongname.font = [UIFont systemFontOfSize:20 * FITHEIGHT];
    [self.contentView addSubview:self.labelSongname];
    
    self.labelSonger = [[UILabel alloc] initWithFrame:CGRectMake(130 * FITWIDTH, 50 * FITHEIGHT, 250 * FITWIDTH, 30 * FITHEIGHT)];
    self.labelSonger.textColor = [UIColor grayColor];
    self.labelSonger.font = [UIFont systemFontOfSize:18 * FITHEIGHT];
    [self.contentView addSubview: self.labelSonger];
    
}

- (void)setModel:(WSMusicModel *)model{
    _model = model;
    [self.imageViewPhoto sd_setImageWithURL:[NSURL URLWithString:model.thumbnail_url] placeholderImage:[UIImage imageNamed:@"1.jpg"]];
    self.labelSonger.text = model.songer;
    self.labelSongname.text = model.songname;
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
